dm: pci: return the real controller in pci_bus_to_hose()
authorMinghuan Lian <[email protected]>
Tue, 13 Dec 2016 06:54:09 +0000 (14:54 +0800)
committerYork Sun <[email protected]>
Wed, 18 Jan 2017 17:25:14 +0000 (09:25 -0800)
for the legacy PCI driver, the function pci_bus_to_hose() returns
the real PCIe controller. To keep consistency, this function is
changed to return the PCIe controller pointer of the root bus
instead of the current PCIe bus.

Signed-off-by: Minghuan Lian <[email protected]>
Signed-off-by: Hou Zhiqiang <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Reviewed-by: York Sun <[email protected]>
drivers/pci/pci_compat.c

index ddaf358e26dc5ffa24012aed736ec73ad8d31037..25bc095dced5279633868b01655cd04bc78db96e 100644 (file)
@@ -49,5 +49,5 @@ struct pci_controller *pci_bus_to_hose(int busnum)
                return NULL;
        }
 
-       return dev_get_uclass_priv(bus);
+       return dev_get_uclass_priv(pci_get_controller(bus));
 }